<?php if(!empty($cards)){?>
    <?php
    $now = strtotime(date("Y-m-d"));
    foreach($cards as $card){
        $class="";
        $exp = strtotime($card['expired']);
        if(($exp < $now && $card['expired']!="0000-00-00") || $card['info']['value']<=0){
            $class="expired";
        }
        ?>
        <ul id="<?=$card['type']?>_<?=$card['info']['id']?>" class="card <?=$class?>">
            <li><?=$card['type']?></li>
            <li>Value: <?=$card['info']['value']?></li>
            <li>Expire: <?php echo ($card['expired']!='0000-00-00')?$card['expired']:"No expired"; ?></li>
            <li><?php if($class!="expired"){ ?><a href="#" class="button" onclick="return select_cart('<?=$card['type']?>','<?=$card['info']['id']?>')">Select</a> <?php } ?></li>
        </ul>
    <?php } 
    ?>
<?php }else{?>
    <p>Sorry , the code not exist in our system!</p>
<?php } ?>